export const fetchRegisterSlice = createAsyncThunk(
	'user/fetchRegisterSlice',
	async (params: { email: string; password: string, name: string }) => {
		try {
			const { data } = await axios.post<IResponseLogin>(`${API}/auth/register`, {
				email: params.email,
				password: params.password,
				name: params.name
			});
			return data;
		} catch (error) {
			if (error instanceof AxiosError) {
				throw new Error(error.response?.data.message);
			}
		}
	}
);